<template>
  <el-container>
    <el-main>
    <div style="text-align:center"><H1>字体购买列表</H1></div>
    <el-button @click="orders">刷新购买记录</el-button>
        <el-table
        :data="Payorderlist"
        height="800"
        border
        style="width: 100%">

        <!-- <el-table-column align="right">
            <template slot="header" slot-scope="scope">
            <el-input
              v-model="fontname"
              size="mini"
              placeholder="输入关键字搜索"/>
            </template>
        </el-table-column> -->
      

        <el-table-column prop="id" label="序号" width="100">
        </el-table-column>
        <el-table-column prop="runtime" label="日期" width="300">
        </el-table-column>
        <el-table-column prop="fonts" label="字体名" width="300">
        </el-table-column>
        
        <el-table-column prop="order" label="订单号" width="300">
        </el-table-column>
        <el-table-column prop="ordernumb" label="平台订单号" width="300">
        </el-table-column>
        
        <el-table-column prop="platform" width="180" label="厂商">
        </el-table-column>
        <el-table-column prop="phone" width="300" label="账号">
        </el-table-column>
        <el-table-column prop="fontprice" width="100" label="字体价格">
        </el-table-column>
        <el-table-column prop="pricenow" width="100" label="账户余额">
        </el-table-column>

        <el-table-column prop="status" width="300" label="购买状态">
        </el-table-column>
        
            
        </el-table>
    </el-main>
  </el-container>
</template>

<script>
import axios from 'axios';
import { orderlist } from '../../api/autopay'; 
export default {
    name: 'autopay',
    data() {
        return {
            Payorderlist: [],
            fullscreenLoading: false,
            fontname:"",
        }
    },
    mounted:function () {
        this.orders()
    },
    methods: {
        orders(){
            var that = this;
            that.fullscreenLoading = true
            let par = {"pagesize":1000,"platform":"","name":""};
            orderlist(par).then(res => {
                let { code, msg, data } = res;
                if (code == 200) {
                    that.Payorderlist = data;
                    that.$message("购买记录获取成功");
                }else{
                  that.$message.error(data);
                }
                }).catch( () => {
                    that.$message.error("数据请求失败");
                });
                that.fullscreenLoading = false
        },
    }//methods

}
</script>